package com.ewhale.feitengguest.widget

import android.app.Dialog
import android.content.Context

import com.ewhale.feitengguest.R
import com.simga.library.activity.MBaseActivity
import com.simga.library.utils.LogUtil
import com.simga.library.utils.glide.GlideUtil
import kotlinx.android.synthetic.main.dialog_handle.*
import kotlinx.android.synthetic.main.dialog_increase_prcie.*

import java.math.BigDecimal

/**
 * 作者：SimGa
 * 日期：2020/2/26
 * 时间：11:04
 * 包名：com.ewhale.feitengguest.widget
 */
class HandlerDialog(context: Context) : Dialog(context, R.style.Dialog) {
    init {
        this.setCanceledOnTouchOutside(true)
        this.setCancelable(true)
        setContentView(R.layout.dialog_handle)

        btn_open.setOnClickListener {
            if (listenter != null) listenter!!.onClickCommit(1)
            dismiss()
        }
        btn_increase_price.setOnClickListener {
            if (listenter != null) listenter!!.onClickCommit(2)
            dismiss()
        }
        btn_increase_number.setOnClickListener {
            if (listenter != null) listenter!!.onClickCommit(3)
            dismiss()
        }
        btn_close.setOnClickListener {
            if (listenter != null) listenter!!.onClickCommit(4)
            dismiss()
        }
    }


    private var listenter: onClickListenter? = null

    fun setListenter(listenter: onClickListenter) {
        this.listenter = listenter
    }

    interface onClickListenter {
        fun onClickCommit(handlerType: Int)
    }
}
